package com.pyb.common.datasource;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 *
 * @author chuchen.zhang
 * @date 17-2-26 上午3:28
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    public static ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    @Override
    protected Object determineCurrentLookupKey() {
        return contextHolder.get();
    }

}
